﻿using MaterialDemo.Model.RoleDTO;
using System;
using System.Collections.Generic;
using System.Text;

namespace MaterialDemo.IService.IPermission
{
    public interface IRoleService
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="inputModel"></param>
        /// <returns></returns>
        int Add(RoleInput inputEntity);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="inputModel"></param>
        /// <returns></returns>
        int Update(RoleInput inputEntity);

        /// <summary>
        /// 普通查询
        /// </summary>
        /// <returns></returns>
        List<RoleOutput> LoadEntities();

        /// <summary>
        /// 根据id查询
        /// </summary>
        /// <returns></returns>
        List<RoleOutput> LoadEntities(int id);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <typeparam name="s"></typeparam>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <param name="whereLambda"></param>
        /// <param name="orderbyLambda"></param>
        /// <param name="isAsc"></param>
        /// <returns></returns>
        List<RoleOutput> LoadPageEntities(int pageIndex, int pageSize, out int totalCount, string selectInfo);

        /// <summary>
        /// 获取用户拥有的角色
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        string GetRoleID(string userID);

        /// <summary>
        /// 给用户配置角色
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="arrRoleID"></param>
        /// <returns></returns>
        bool ConfigRole(string userID, string arrRoleID);

        /// <summary>
        /// 开启/禁用角色
        /// </summary>
        /// <param name="id"></param>
        /// <param name="flag"></param>
        /// <returns></returns>
        bool ForbidRole(int id, string flag);

        /// <summary>
        /// 判断RoleID是否重复
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        bool CheckRepeat(string value);

    }
}
